package com.example.redis.strategy;

import java.util.HashMap;
import java.util.Map;

public class StrategyFactory {

    private static Map<String, IStrategy> map=new HashMap<>();

    private StrategyFactory() {

    }
    static {
        map.put("春天", new Strategy1());
        map.put("夏天", new Strategy2());
        map.put("秋天", new Strategy3());
        map.put("冬天", new Strategy4());
    }

    public static IStrategy getStrategy(String strategy) {
        return map.get(strategy);
    }
}
